home *** CD-ROM | disk | FTP | other *** search
/ Georgia Wildfire Prevention / Georgia Wildfire Prevention.iso / pc / media / dirs / BackUp / Glossary.dir / 00013_Script_Special Button Behavior < prev    next >
Text File  |  2002-10-15  |  3KB  |  77 lines

  1. --PROPERTIES--
  2. --Hot: The member switched to (hot state).
  3. --FlashSpeed: The speed in which the sprite flashes measured in ticks (1/60th of a sec.)
  4. --Message: The message sent to the stage.
  5. --Glowing: Lets the function know if the sprite is hot or cold.
  6. --RollOvr: The member switched to when rolled-over.
  7. --ButtonSound: The sound that will play when clicked. Channel 2 is reserved for short sounds.
  8. --TimeTracker: Times out the seconds between flashes.
  9. --SpNum: The sprite number of the sprite.
  10. --MyNum: The member's number.
  11. --FlashWait: How long to wait before flashing
  12.  
  13. global zeus
  14. property Hot, FlashSpeed, Message, Glowing, RollOvr, ButtonSound, TimeTracker, SpNum, MyNum, FlashWait
  15.  
  16. --Captures the spritenumber.
  17. on new me
  18.   SpNum = me.spritenum
  19.   MyNum=sprite(SpNum).member.number
  20. end
  21.  
  22. --Creates the dialog box for the behavior.
  23. on getpropertydescriptionlist me
  24.   set pList = [#Hot:[#comment: "What is the cast member name for the Hot state?", #format: #string, #default: ""], \
  25.  #RollOvr: [#comment: "Which member would you like to use for the rollover?", #format: #string, #default: ""], \
  26.  #ButtonSound:[#comment: "What sound would you like to play when the button is pressed?",#format:#string,#default:"Click"],\
  27.  #Message:[#comment:"What movie would you like to open?",#format:#string,#default: "Next"],\
  28.  #FlashSpeed:[#comment:  "How often would you like the member to flash (ticks)?", #format: #integer, #range: [#min: 0, #max: 60], #default: 0], \
  29.  #FlashWait: [#comment: "How Long would you like to wait before Flashing (ticks)?", #format:#integer, #default: "0"]]
  30.   return plist
  31. end
  32.  
  33. --This toggles the flashing object back  and forth at the desired speed while the mouse is not over it.
  34. --on prepareframe me
  35. --  if FlashSpeed <> 0 then
  36. --    if the timer > FlashWait then
  37. --      if sprite(SpNum).cursor <> 280 then
  38. --        set TimeTracker = the ticks
  39. --        repeat while the ticks < TimeTracker + FlashSpeed
  40. --          nothing
  41. --        end repeat
  42. --        if Glowing = 0 then
  43. --          sprite(SpNum).membernum = member(Hot).number
  44. --          Glowing = Glowing + 1
  45. --        else
  46. --          sprite(SpNum).membernum = member(MyNum).number
  47. --          Glowing = GLowing - 1
  48. --        end if
  49. --        updateStage
  50. --      end if
  51. --    end if
  52. --  end if
  53. --end
  54.  
  55. --This is for the rollover.
  56. on mouseenter me
  57.   sprite(SpNum).membernum = member(RollOvr).number
  58.   sprite(SpNum).cursor = 280  
  59.   updateStage  
  60. end
  61. on mouseleave me
  62.   sprite(SpNum).membernum = member(MyNum).number
  63.   sprite(SpNum).cursor = 293 
  64.   Glowing = 0
  65.   updateStage
  66. end
  67.  
  68. --This goes to another frame and tells the movie what to do. Also plays the sound, if any.
  69. on mousedown me
  70.   if  ButtonSound <> "" then
  71.     sound(2).play(member(ButtonSound)) 
  72.   end if
  73.   WhichMovie (zeus, message)
  74. end
  75.  
  76.  
  77.